﻿#include "iQTextCursor.h"

void iQTextCursor::insertMarkdown(const QString& markdown, QTextDocument::MarkdownFeatures features)
{
	QTextCursor::insertMarkdown(markdown, features);
	//QTextCursor::insertMarkdown(markdown);
	//
	/*if (!d || !d->priv)
		return;
	QTextDocumentFragment fragment = QTextDocumentFragment::fromMarkdown(markdown, features);
	if (markdown.startsWith(QLatin1Char('\n')))
		insertBlock(fragment.d->doc->firstBlock().blockFormat());
	insertFragment(fragment);
	if (!atEnd() && markdown.endsWith(QLatin1Char('\n')))
		insertText(QLatin1String("\n"));*/

}

iQTextDocumentFragment iQTextCursor::selection() const {
	return QTextCursor::selection();
}

//void iQTextCursor::select(SelectionType selection)
//{
//	QTextCursor::select(selection);
//	if (selection == LineUnderCursor) {
//		QTextCursor::clearSelection();
//
//		this->select(QTextCursor::BlockUnderCursor);
//		QString array = this->selection().toMarkdown();
//
//	}
//}
